<template>
	<view class="collect">
		<view class="navbar" :style="{height: systemBarHeight + 'px'}">
		</view>
		<view class="login">
			<image src="/static/logn1.png" mode=""></image>
			<text>欢迎登录机器人站</text>
		</view>

		<view class="information">
			<view class="information_item">
				<text>联系电话</text>
				<input type="text" value="" placeholder="手机号码" placeholder-style="" />
			</view>
			<view class="information_item1">
				<text>验证码</text>
				<input type="text" value="" placeholder="请输入验证码" placeholder-style="" />
				<view class="code" @click="getCheckNum()">
					<text>{{!codeTime?'获取验证码':codeTime+'s'}}</text>
				</view>
			</view>
		</view>
		
		<view class="iphonelogin">
			<button type="default">登录</button>
		</view>
		<view class="wechatlogin">
			<button type="default">微信授权一键登录</button>
		</view>
		
		<view class="agreement" @click="agreementChange()">
			<image src="/static/xieyi.png" mode="" v-show="!agreement"></image>
			<image src="/static/xieyi2.png" mode="" v-show="agreement"></image>
			<text>已阅读协议《协议链接》</text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				systemBarHeight: 0,
				codeTime: 0,
				agreement:false
			}
		},
		mounted() {
			this.getSysteminfo()
		},
		methods: {
			/* 手机顶部高度 */
			getSysteminfo() {
				uni.getSystemInfo({
					success: res => {
						this.systemBarHeight = res.statusBarHeight;
					}
				});
			},
			/* 验证码倒计时 */
			getCheckNum() {
				if (this.codeTime > 0) {
					uni.showToast({
						title: '不能重复获取',
						icon: "none"
					});
					return;
				} else {
					this.codeTime = 60
					let timer = setInterval(() => {
						this.codeTime--;
						if (this.codeTime < 1) {
							clearInterval(timer);
							this.codeTime = 0
						}
					}, 1000)
				}
			},
			
			agreementChange(){
			this.agreement=!this.agreement	
			}


		}
	}
</script>

<style lang="scss" scoped>
	.collect {
		width: 750rpx;
		height: 1626rpx;
		background: #FFFFFF;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.login {
		display: flex;
		flex-direction: column;
		margin-top: 135rpx;

		>image {
			width: 95rpx;
			height: 95rpx;
			border-radius: 8rpx 8rpx 8rpx 8rpx;
			margin: auto;
		}

		>text {
			margin: 30rpx auto 0;
			font-family: PingFang SC, PingFang SC;
			font-weight: 500;
			font-size: 34rpx;
			color: #333333;
		}
	}

	.information {
		width: 88%;
		margin: 91rpx auto 0;

		.information_item {
			display: flex;
			padding-bottom: 30rpx;
			border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);

			>text {

				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				font-size: 31rpx;
				color: #7D8CA4;
				width: 30%;
			}

			>input {}
		}

		.information_item1 {
			display: flex;
			margin-top: 20rpx;
			align-items: center;

			>text {
				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				font-size: 31rpx;
				color: #7D8CA4;
				width: 30%;
			}

			.code {
				width: 153rpx;
				height: 63rpx;
				background: #F8F8FA;
				border-radius: 8rpx 8rpx 8rpx 8rpx;
				display: flex;
				justify-content: center;
				align-items: center;

				>text {
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					font-size: 23rpx;
					color: #45516B;
				}
			}
		}
	}

	.information_item input /deep/ .input-placeholder {

		font-family: PingFang SC, PingFang SC;
		font-weight: 400;
		font-size: 31rpx;
		color: #CCCCCC;
	}

	.information_item1 input /deep/ .input-placeholder {
		font-family: PingFang SC, PingFang SC;
		font-weight: 400;
		font-size: 31rpx;
		color: #CCCCCC;
	}
	.iphonelogin{
		margin-top: 112rpx;
		display: flex;
		justify-content: center;
	}
	.iphonelogin button{
		width: 626rpx;
		height: 95rpx;
		background: #1677FF;
		border-radius: 8rpx 8rpx 8rpx 8rpx;
	
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 34rpx;
		color: #FFFFFF;
		display: flex;
		justify-content: center;
		align-items: center;

	}
	.wechatlogin{
		display: flex;
		justify-content: center;
		margin-top: 30rpx;
	}
	.wechatlogin button{
		width: 626rpx;
		height: 95rpx;
		background: #1AAD19;
		border-radius: 8rpx 8rpx 8rpx 8rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 34rpx;
		color: #FFFFFF;
		display: flex;
		justify-content: center;
		align-items: center;
	}
	.agreement{
		display: flex;
		justify-content: center;
		align-items: center;
		margin-top: 30rpx;
		height: 50rpx;
		>image{
			width: 34.35rpx;
			height: 34.35rpx;
		}
		>text{
			font-family: PingFang SC, PingFang SC;
			font-weight: 400;
			font-size: 27rpx;
			color: #7D8CA4;
			margin-left: 15rpx;
		}
	}
</style>